<?php

class panel_search_tab extends QPanel {

    public $textfield_search_project;
    public $button_search_project;
    public $textfield_search_provider;
    public $button_search_provider;

    public $listbox_search_project;
    public $listbox_search_provider;

    public $checkbox_search_project;
    public $checkbox_search_provider;

    // Create QForm Event Handlers as Needed

    //		protected function Form_Exit() {}
    //		protected function Form_Load() {}
    //		protected function Form_PreRender() {}

    public function __construct($objParentObject, $strControlId = null) {
        // First, let's call the Parent's __constructor
        try {
            parent::__construct($objParentObject, $strControlId);
        } catch (QCallerException $objExc) {
            $objExc->IncrementOffset();
            throw $objExc;
        }

        //Form_Create();
        $this->textfield_search_project_Create();
        $this->button_search_project_Create();
        $this->listbox_search_project_Create();
        $this->checkbox_search_project_Create();

        $this->textfield_search_provider_Create();
        $this->button_search_provider_Create();
        $this->listbox_search_provider_Create();
        $this->checkbox_search_provider_Create();
    }

    protected function textfield_search_project_Create() {
        $this->textfield_search_project = new QTextBox($this);
        //$this->textfield_search->Name = 'サイト名検索';
        $this->textfield_search_project->MaxLength=200;
        //$this->textfield_search->Width=200;
        $this->textfield_search_project->CssClass = 'input w245';
        //$this->textfield_search->Style = '';
    }

    protected function button_search_project_Create() {
        $this->button_search_project = new QButton($this);
        $this->button_search_project->Text = 'Go';
        $this->button_search_project->AddAction(new QClickEvent(), new QServerAction('search_projects_Click'));
        $this->button_search_project->PrimaryButton = true;
        $this->button_search_project->CausesValidation = true;
    }

    protected function listbox_search_project_Create() {
        $this->listbox_search_project = new QListBox($this);
        $this->listbox_search_project->AddItem("All Categories");
        $this->listbox_search_project->AddItem("Design");
        $this->listbox_search_project->AddItem("Software");
        $this->listbox_search_project->AddItem("Design & Software");
        $this->listbox_search_project->AddItem("Management & Support");
        $this->listbox_search_project->AddItem("Writing & Translation");
        $this->listbox_search_project->AddItem("Sound & Multimedia");
        $this->listbox_search_project->AddItem("Accounting");
        $this->listbox_search_project->AddItem("Marketing");
        $this->listbox_search_project->Width=254;
        $this->listbox_search_project->CssClass = 'input leftt';
        $this->listbox_search_project->AddAction(new QChangeEvent(), new QServerAction('listbox_search_projects_Click'));
        //$this->listbox_search_project->SelectedIndex=3;
    }

    protected function checkbox_search_project_Create() {
        $this->checkbox_search_project = new QCheckBox($this);
    }

    protected function textfield_search_provider_Create() {
        $this->textfield_search_provider = new QTextBox($this);
        //$this->textfield_search->Name = 'サイト名検索';
        $this->textfield_search_provider->MaxLength=200;
        //$this->textfield_search->Width=200;
        $this->textfield_search_provider->CssClass = 'input w245';
        //$this->textfield_search->Style = '';
    }

    protected function button_search_provider_Create() {
        $this->button_search_provider = new QButton($this);
        $this->button_search_provider->Text = 'Go';
        $this->button_search_provider->AddAction(new QClickEvent(), new QServerAction('search_providers_Click'));
        $this->button_search_provider->PrimaryButton = true;
        $this->button_search_provider->CausesValidation = true;
    }

    protected function listbox_search_provider_Create() {
        $this->listbox_search_provider = new QListBox($this);
        $this->listbox_search_provider->AddItem("All Categories");
        $this->listbox_search_provider->AddItem("Design");
        $this->listbox_search_provider->AddItem("Software");
        $this->listbox_search_provider->AddItem("Design & Software");
        $this->listbox_search_provider->AddItem("Management & Support");
        $this->listbox_search_provider->AddItem("Writing & Translation");
        $this->listbox_search_provider->AddItem("Sound & Multimedia");
        $this->listbox_search_provider->AddItem("Accounting");
        $this->listbox_search_provider->AddItem("Marketing");
        $this->listbox_search_provider->Width=254;
        $this->listbox_search_provider->CssClass = 'input leftt';
    }

    protected function checkbox_search_provider_Create() {
        $this->checkbox_search_provider = new QCheckBox($this);
    }

    // Other Methods
    public function set_index_listbox_search_project($index_)
    {
        $this->listbox_search_project->SelectedIndex=$index_;
    }

    public function set_index_listbox_search_provider($index_)
    {
        $this->listbox_search_provider->SelectedIndex=$index_;
    }

    //test
    protected function RedirectToListPage() {
        QApplication::Redirect(__VIRTUAL_DIRECTORY__ . '/index_2.php');
    }
}

?>